/**
 * 命名=> api_xxx
 */
import { request } from '../request'
import { useUserStore } from '@/store/user'
import storage from '@/utils/storage'

// 根据code 返回token
export const api_get_token = (data = {}) => {
	return request({ url: '/api/h5/anno/wx/toWxId', method: 'post', data })
}

// 获取用户信息
export const api_get_myInfo = async (data = {}) => {
	let res = await request({ url: '/api/h5/main/getMyInfo', method: 'post', data: data })
	if (res.code === 0) {
		useUserStore().setUserInfo(res.data.userInfo)
	}
	return res
}